package com.cloud.wyf.Mapper;

import com.cloud.wyf.Entity.Ordinary;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface OrdinaryMapper {

    @Insert("<script> insert into ordinary "
            + "(uid,realname,part,vote) "
            + "values "
            + "<foreach collection = 'list' item='record' separator=',' > "
            + " (#{record.uid},#{record.realname},#{record.part},#{record.vote}) "
            + "</foreach>"
            + "</script>")
    int MultiAdd(List<Ordinary> list);

    @Select("select * from ordinary where uid=#{uid}")
    Ordinary selectById(String uid);

    @Select("select * from ordinary")
    List<Ordinary> selectAllOrdinary();

    @Update("update ordinary set status=#{status} ")
    int updateStatus(int status);
}
